package com.dwd.basic.query;

import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description: TODO
 * @Author 汶狄
 * @Date 2021/1/12 11:08
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class BaseQuery {
    @ApiModelProperty("当前页")
    private Integer localPage = 1;
    @ApiModelProperty("每页条数")
    private Integer pageSize = 5;

    @ApiOperation("起始索引，从哪里开始")
    public Integer getBegin() {
        return (this.localPage - 1) * this.pageSize;
    }
}
